package com.dnjn.happiness.score.enums;


import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum AdviceEnum {
    A(1, 0.0),

    B(2, 1.0),

    C(3, 2.0),

    D(4, 3.0),

    E(5, 4.0),

    F(6, 5.0),

    G(7, 6.0),

    H(8, 7.0),

    I(9, 8.0),

    J(10, 9.0);


    @Getter
    private Integer star;
    @Getter
    private Double score;


    public static Double getScore(Integer appriseLikeCount) {
        AdviceEnum[] values = AdviceEnum.values();
        for (AdviceEnum adviceEnum : values) {
            if (appriseLikeCount.equals(adviceEnum.star)) {
                return adviceEnum.score;
            }
        }
        return 0.0;

    }
}